
package com.idealighter.game.shop.handler;

import com.google.inject.Inject;

import com.idealighter.game.core.annotation.ReqMsgHandler;
import com.idealighter.game.message.core.ReqMessage;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.player.struct.Player;
import com.idealighter.game.server.handler.ReqMessageHandler;
import com.idealighter.game.shop.manager.ShopMgr;
import com.idealighter.game.shop.message.ReqBuyItemMsg;


@ReqMsgHandler(103101)
public class ReqBuyItemHandler implements ReqMessageHandler {

  @Inject
  private ShopMgr shopMgr;

  @Override
  public ResMessage action(Player player, ReqMessage message) {
    ReqBuyItemMsg msg = (ReqBuyItemMsg) message;
    shopMgr.buyItem(player, msg.getItemId(), msg.getNum(), msg.getMoneyType());

    return null;
  }
}
